/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package trunk.controller;

import java.awt.Color;
import trunk.model.EDrawTool;
import trunk.model.ElementGeo;
import trunk.model.PaintModel;


/**
 * Class PaintController 
 * 
 * Controller Principal de l'application
 * 
 * @author LEFEVRE Michael
 * @author THOUE Jonathan
 */
public class PaintController {

    private PaintModel model;
    private Color currentColor;
    private EDrawTool currentTool;

    /**
     * Réinitialise le model
     */
    public void reset(){
        this.model.reset(); 
    };
    /**
     * Ajoute un element
     */
    public  void addElement(ElementGeo element){
        this.model.addElement(element);
    };
    /**
     * Change la couleur courrante
     */
    public void setColor(Color color){
        this.model.setColor(color);
    };
    /**
     * Change l'outil courrant
     */
    public void setTool(EDrawTool tool){
        this.model.setTool(tool);
    };
    /**
     * Get model
     * @return le model
     */
    public PaintModel getModel() {
        return model;
    }    
    /**
     * Constructeur du controler
     * @param model - modele de l'application
     */
    public PaintController(PaintModel model) {
        this.model = model;
        currentColor = Color.black;
        currentTool = EDrawTool.POINT;
    }
}
